import 'package:flutterstudyapplast/business/models/article_collect_item.dart';
import 'package:flutterstudyapplast/services/api/api.dart';
import 'package:flutterstudyapplast/services/articlecollect/article_collect_service.dart';
import 'package:flutterstudyapplast/services/service_locator.dart';

class ArticleCollcetSericeImpl extends ArticleCollectService{
  Api _api = serviceLocator<Api>();

  @override
  Future<Map<String,dynamic>> getArticleCollects(int page) async{
    // TODO: implement getArticleCollects
    var result = await _api.getArticleCollects(page);
    if(result != null){
      return result;
    }
    return null;
  }
  @override
  Future<List<ArticleCollctItem>> getWebSiteCollects() async{
    // TODO: implement getWebSiteCollects
    var result = await _api.getWebsiteCollects();
    if(result != null){
      return result;
    }
    return null;
  }

  @override
  Future<Map<String, dynamic>> collectWebsite(String name, String url) async{
    // TODO: implement collectWebsite
    var result = await _api.collectWebsite(name, url);
    if(result != null){
      return result;
    }
    return null;
  }

  @override
  Future<Map<String, dynamic>> unCollectWebsite(int id) async{
    // TODO: implement unCollectWebsite
    var result = await _api.unCollectWebsite(id);
    if(result != null){
      return result;
    }
    return null;
  }

  @override
  Future<Map<String, dynamic>> collectArticle(int id) async{
    // TODO: implement collectArticle
    var result = await _api.collectArticle(id);
    if(result != null){
      return result;
    }
    return null;
  }

  @override
  Future<Map<String, dynamic>> unCollectArticle(int id) async{
    // TODO: implement unCollectArticle
    var result = await _api.unCollectArticle(id);
    if(result != null){
      return result;
    }
    return null;
  }

}